package com.wyh.socket_demo.component;

import com.wyh.socket_demo.endpoint.FileServer;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author wyh
 * @version 1.0
 * @date 2022/4/12 16:10
 */
@Component
public class Consumer implements ApplicationRunner {
    @Override
    public void run(ApplicationArguments args) throws Exception {
        FileServer s = new FileServer( 9999 );
        s.start();
        System.out.println( "FileServer started on port: " + s.getPort() );
        Thread.sleep(Long.MAX_VALUE);
    }
}
